/* 获取元素 */
const insert = document.getElementById("insert");

/* 监听键盘事件 */
window.addEventListener("keydown", (event) => {
  /* 更改insert内容 */
  console.log(event);
  insert.innerHTML = `<div class='key'>
  ${event.key === " " ? "Space" : event.key}
  <small>event.key</small>
  </div>
  <div class="key">${event.keyCode}
    <small>event.code</small>
  </div>
  <div class = "key">
  ${event.code}
  <small>event.code</small>
  </div>
  `;
});
